home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 March
/
EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso
/
earcd
/
music
/
clips.lha
/
Clips.s
< prev
next >
Wrap
Text File
|
1996-01-28
|
5KB
|
267 lines
Section CLIPS,Code
opt !
Incdir Include:
Include mysystem.i
Include libraries/xpk.i
Include lib/xpkmaster_lib.i
Include libraries/reqtools.i
Include lib/reqtools_lib.i
Include libraries/playsidbase.i
Include lib/playsid_lib.i
CLIPS_PLAY Equ 0
CLIPS_STOP Equ 1
CLIPS_CHANGE Equ 2
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Start: Bsr ProcessArgs
Move.L $4.w,A6
Move.L A6,_EXECBase
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lea (Title,PC),A1
CALL FindPort
Tst.L D0
Beq.S .NoPort
Move.L D0,A0
Lea (_MyMsg,PC),A1
CALL PutMsg
.NoPort Cmp.W #CLIPS_PLAY,_MsgType
Bne CloseDown
CALL CreateMsgPort
Move.L D0,_MyMsgPort
Beq CloseDown
Move.L D0,A1
Moveq #0,D0
Move.B (MP_SIGBIT,A1),D0
Moveq #1,D1
Lsl.L D0,D1
Move.L D1,_SignalSet
Move.L #Title,LN_NAME(A1)
Move.B #5,LN_PRI(A1)
CALL AddPort
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lea (XPKLibrary,PC),A1
Moveq #0,D0
CALL OpenLibrary
Move.L D0,_XPKBase
Beq CloseDown
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lea (XPKTags,PC),A0
CALL XpkUnpack,XPK
Tst.L D0
Bne CloseDown
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lea (PSLibrary,PC),A1
Moveq #0,D0
CALL OpenLibrary,EXEC
Move.L D0,_PLAYSIDBase
Beq CloseDown
CALL AllocEmulResource,PLAYSID
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Move.L (_OutputBuffer,PC),A0
CALL CheckModule
Tst.L D0
Bne BadMOD
Move.L (_OutputBuffer,PC),A0
Move.L A0,A1
Move.L (_OutputBufLen,PC),D0
CALL SetModule
Moveq #50,D0
CALL SetVertFreq
Moveq #0,D0
Move.L (_OutputBuffer,PC),A0
Move.W (sidh_defsong,A0),D0
Move.L D0,_SongNum
Move.W (sidh_number,A0),D0
Move.L D0,RTTags+4 ;max songs
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
MainLoop: Move.L (_SongNum,PC),D0
CALL StartSong,PLAYSID
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
.WaitLoop Move.L (_SignalSet,PC),D0
Bset #SIGBREAKB_CTRL_C,D0
CALL Wait,EXEC
Move.L D0,D4
Move.L (_MyMsgPort,PC),A0
CALL GetMsg
Move.L D0,_MsgReceived
Btst #SIGBREAKB_CTRL_C,D4
Bne.S ShutDown
Tst.L _MsgReceived
Beq.S ShutDown
Move.L (_MsgReceived,PC),A0
Lea (MN_SIZE,A0),A0
Move.W (A0)+,D0
Cmp.W #CLIPS_CHANGE,D0
Bne.S ShutDown
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Cmp.L #1,RTTags+4
Beq.S .NumOk
Tst.L _REQTOOLSBase
Bne.S .RTOk
Lea (RTLibrary,PC),A1
Moveq #38,D0
CALL OpenLibrary,EXEC
Move.L D0,_REQTOOLSBase
Beq.S .NumOk
.RTOk Lea (_SongNum,PC),A1
Lea (Title,PC),A2
Sub.L A3,A3
Lea (RTTags,PC),A0
CALL rtGetLongA,REQTOOLS
Tst.L D0
Beq .WaitLoop
.NumOk CALL StopSong,PLAYSID
Bra MainLoop
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
ShutDown: CALL StopSong,PLAYSID
BadMOD: CALL FreeEmulResource
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
CloseDown: Move.L (_OutputBuffer,PC),A1
Cmp.L #0,A1
Beq.S .NoMem
Move.L (_OutputBufLen,PC),D0
CALL FreeMem,EXEC
.NoMem
Move.L (_PLAYSIDBase,PC),A1
Cmp.L #0,A1
Beq.S .NoPS
CALL CloseLibrary,EXEC
.NoPS
Move.L (_XPKBase,PC),A1
Cmp.L #0,A1
Beq.S .NoXPK
CALL CloseLibrary,EXEC
.NoXPK
Move.L (_REQTOOLSBase,PC),A1
Cmp.L #0,A1
Beq.S .NoRT
CALL CloseLibrary,EXEC
.NoRT
Move.L (_MyMsgPort,PC),A4
Cmp.L #0,A4
Beq.S .NoMsg
Move.L A4,A1
CALL RemPort,EXEC
Move.L A4,A0
CALL DeleteMsgPort
.NoMsg
Rts
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
ProcessArgs: Clr.B -1(A0,D0.l)
Lea _ArgString,A1
Moveq #0,D0
.ArgLoop Move.B (A0)+,D0
Beq.S .Exit
Cmp.B #'\"',D0
Beq.S .Skip
Bsr.S ChangeCase
Move.B D0,(A1)+
.Skip Bra.S .ArgLoop
.Exit Move.B #0,(A1)+
Move.L _ArgString,D0
Bne.S .NotStop
Move.W #CLIPS_STOP,_MsgType
Rts
.NotStop Cmp.L #'CHAN',D0
Bne.S .NotChange
Move.L _ArgString+4,D0
Cmp.L #$47450000,D0
Bne.S .NotChange
Move.W #CLIPS_CHANGE,_MsgType
Rts
.NotChange Move.W #CLIPS_PLAY,_MsgType
Rts
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
ChangeCase: Cmp.B #'a',D0
Blo.S .exit
Cmp.B #'z',D0
Bgt.S .exit
.change Sub.B #32,D0
.exit Rts
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Version: Dc.B 0,'$VER: CLI_PlaySID 0.05 (22.10.95)',0
XPKLibrary: XPKMASTERNAME
PSLibrary: PLAYSIDNAME
RTLibrary: REQTOOLSNAME
Title: Dc.B 'CLI PlaySID',0
SongNumber: Dc.B 'Please select a new song',0
Even
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
XPKTags: Dc.L XPK_InName,_ArgString
Dc.L XPK_GetOutBuf,_OutputBuffer
Dc.L XPK_GetOutLen,_OutputLength
Dc.L XPK_GetOutBufLen,_OutputBufLen
Dc.L XPK_PassThru,-1
Dc.L TAG_DONE
RTTags: Dc.L RTGL_Max,1
Dc.L RTGL_Min,1
Dc.L RTGL_TextFmt,SongNumber
Dc.L RTGL_Flags,GLREQF_CENTERTEXT
Dc.L RT_ReqPos,REQPOS_CENTERSCR
Dc.L TAG_DONE
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
_EXECBase: Dc.L 0
_XPKBase: Dc.L 0
_PLAYSIDBase: Dc.L 0
_REQTOOLSBase: Dc.L 0
_OutputBuffer: Dc.L 0
_OutputLength Dc.L 0
_OutputBufLen: Dc.L 0
_MyMsgPort: Dc.L 0
_SignalSet: Dc.L 0
_MsgReceived: Dc.L 0
_SongNum: Dc.L 0
_MyMsg: Ds.B MN_SIZE-2
Dc.W 2
_MsgType: Dc.W CLIPS_PLAY ;STOP/CHANGE
;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Section ClipsData,BSS
_ArgString: Ds.B 256